/*
 * @Author: WangLong
 * @Date: 2024-01-24 10:58:16
 * @LastEditTime: 2024-02-29 15:56:08
 * @LastEditors: WangLong
 * @Description:
 * @FilePath: \front_erp\src\api\stock\outorder.js
 */
import request from "@/utils/request";

// 获取出库列表
export function getOutorderListApi(query, data) {
  return request({
    url: "/system/deliveryApply/findListPage",
    method: "post",
    params: query,
    data,
  });
}
// 新增出库申请
export function addDeliveryApi(data) {
  return request({
    url: "/system/deliveryApply",
    method: "post",
    data,
  });
}
// 编辑出库申请
export function editDeliveryApi(data) {
  return request({
    url: "/system/deliveryApply/update",
    method: "post",
    data,
  });
}
// 删除出库申请
export function deleteDelivery(deliveryApplyId) {
  return request({
    url: `/system/deliveryApply/remove/${deliveryApplyId}`,
    method: "post",
  });
}
// 获取出库表格详情
export function getDeliveryApplyApi(deliveryApplyId) {
  return request({
    url: `/system/deliveryApply/${deliveryApplyId}`,
    method: "get",
  });
}

// 获取出库物料信息详情
export function findMaterialList(params) {
  return request({
    // url: `/system/deliveryApply/findMaterialList/${deliveryApplyId}`,
    url: `/system/deliveryApply/findMaterialList`,
    method: "get",
    params,
  });
}
// 出库审核
export function checkDeliveryApi(data) {
  return request({
    url: "/system/deliveryApply/approval",
    method: "post",
    data,
  });
}
// 库存物料列表
export function selectInventoryList(data) {
  return request({
    url: "/system/deliveryApply/selectInventoryList",
    method: "post",
    data,
  });
}
// // 运维工单
// export function maintenanceApply(data) {
//   return request({
//     url: "/system/MaintenanceApply/list",
//     method: "post",
//     data,
//   });
// }

// 运维工单更改
export function maintenanceApply(data) {
  return request({
    url: "/system/MaintenanceApply/selectMainOrderApplyAllPullList",
    method: "post",
    data:{},
  });
}

// 出库功能
export function updateDeliveryOfCargo(data) {
  return request({
    url: "/system/deliveryApply/updateDeliveryOfCargo",
    method: "post",
    data,
  });
}
// 获取用户信息
export function getUserInfo() {
  return request({
    url: "/system/user/getInfo",
    method: "get",
  });
}
// 出库功能
export function selectMaterialDetailsList(deliveryApplyId) {
  return request({
    url: `/system/deliveryApply/selectMaterialDetailsList`,
    method: "get",
    params: { deliveryApplyId },
  });
}
// 审核进度
export function selectAuditList(deliveryApplyId) {
  return request({
    url: `/system/deliveryApply/selectAuditList`,
    method: "get",
    params: { deliveryApplyId },
  });
}
